/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package officeboost.entity.form;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import officeboost.util.FormTypes;
import org.jbpm.api.ExecutionService;
import org.jbpm.api.ProcessInstance;

/**
 *
 * @author wangfrank
 */
@Entity
public class LectureForm extends AbstractForm implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    private String applier;
    private String kinde_of_lec;
    private String title;
    private String date;
    private String location;
    private String name;
    private String company;
    private String position;
    private String bank_id;
    private String uid; // 身份id 前端的ID
    private String audience;
    private String opinion;
    private int status;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getApplier() {
        return applier;
    }

    public void setApplier(String applier) {
        this.applier = applier;
    }

    public String getAudience() {
        return audience;
    }

    public void setAudience(String audience) {
        this.audience = audience;
    }

    public String getBank_id() {
        return bank_id;
    }

    public void setBank_id(String bank_id) {
        this.bank_id = bank_id;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getKinde_of_lec() {
        return kinde_of_lec;
    }

    public void setKinde_of_lec(String kinde_of_lec) {
        this.kinde_of_lec = kinde_of_lec;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOpinion() {
        return opinion;
    }

    public void setOpinion(String opinion) {
        this.opinion = opinion;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LectureForm)) {
            return false;
        }
        LectureForm other = (LectureForm) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
	return id+". "+"讲座"+"（状态："+status+"）";
    }

    @Override
    public String apply(ExecutionService es) {
        ProcessInstance processInstance = es.startProcessInstanceByKey(FormTypes.LectureForm.toString(), id.toString());
        return processInstance.getId();
    }

    @Override
    public Long theId() {
	return getId();
    }    
    
}
